package com.ruoyi.gbase.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.gbase.domain.VSms;
import com.ruoyi.gbase.service.IVSmsService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

/**
 * 大额短信发送Controller
 * 
 * @author yys
 * @date 2024-11-15
 */
@Controller
@RequestMapping("/gbase/SMS")
public class VSmsController extends BaseController
{
    private String prefix = "gbase/SMS";

    @Autowired
    private IVSmsService vSmsService;

    @RequiresPermissions("gbase:SMS:view")
    @GetMapping()
    public String SMS()
    {
        return prefix + "/SMS";
    }

    /**
     * 修改大额短信发送
     */
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("id") String id, ModelMap mmap)
    {
        VSms vSms = vSmsService.selectVSmsById(id);
        mmap.put("vSms", vSms);
        return prefix + "/edit";
    }

    /**
     * 修改保存大额短信发送
     */
    @RequiresPermissions("gbase:SMS:edit")
    @Log(title = "大额短信发送", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(VSms vSms)
    {
        return toAjax(vSmsService.updateVSms(vSms));
    }

}
